﻿using ProjBackEnd.Lib;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace ProjBackEnd.Models
{
    /// <summary>
    /// 基本用户请求
    /// </summary>
    public class BaseUserRequest
    {
        /// <summary>
        /// 用户系统id（仅内部交互）
        /// </summary>
        [Required(ErrorMessage = "用户ID不能为空")]
        [StringLength(20, ErrorMessage = "ID非法")]
        public string memberid { get; set; }

        /// <summary>
        /// 公司代码
        /// </summary>
        [Required(ErrorMessage = "公司代码不能为空")]
        [StringLength(4, ErrorMessage = "公司代码非法")]
        public string comcd { get; set; }

        /// <summary>
        /// 用户请求所属平台。APP；PC；WEB
        /// </summary>
        [Required(ErrorMessage = "平台代码不能为空")]
        [StringLength(4, ErrorMessage = "平台代码非法")]
        public string platcd { get; set; } //目前接受的平台代码：APP；PC；WEB

    }

    /// <summary>
    /// 基本分页请求
    /// </summary>
    public class BasePageingRequest
    {
        /// <summary>
        /// 当前页码
        /// </summary>
        [Required(ErrorMessage = "当前页码不能为空")]
        [Range(1,10000,ErrorMessage = "页码超限")]
        public int currpage { get; set; }
        /// <summary>
        /// 单页数据量
        /// </summary>
        [Required(ErrorMessage = "单页数据量不能为空")]
        [Range(1, GlobalSettings.MAXPAGESIZE, ErrorMessage = "单页数据量值超限")]
        public int pagesize { get; set; }
    }

    /// <summary>
    /// 基本微信用户请求
    /// </summary>
    public class BaseWxUserRequest
    {
        /// <summary>
        /// 微信开放平台id
        /// </summary>
        public string unionid { get; set; } = "";
        /// <summary>
        /// 微信公众平台id
        /// </summary>
        public string openid { get; set; } = "";
        /// <summary>
        /// 人员id
        /// </summary>
        public int personid { get; set; }
    }

}